<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2022/3/31
  Time: 19:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册页面</title>
    <style>
        *{
            margin: 0px;
            padding: 0px;
            box-sizing: border-box;
            color: black;
        }
        body{
            background: url("${pageContext.request.contextPath }/images/97b97ee1173042d5ba667df7ecbe43f6.png" )  no-repeat ;
            background-size: 1920px 1200px;
        }
        .rg_layout{
            width: 800px;
            height: 500px;
            /*            border: 5px solid #EEEEEE;*/
            background-color: white;
            margin-left: 100px;
            margin-top: 180px;
            border-radius: 10px;
            border: 7px solid orange;
        }
        .rg_left{
            /*border: 1px red solid;*/
            float: left;
            margin: 15px;
        }
        .rg_center{
            /*border: 1px red solid;*/
            float: left;
            margin-left: 60px;
            margin-top: 40px;

        }
        .rg_right{
            /*border: 1px red solid;*/
            float: right;
            margin: 10px;
        }

        .rg_left > p:first-child{
            color: #FFD026;
            font-size: 18px;
        }
        .rg_left >p:last-child{
            color: #A6A6A6;
            font-size: 16px;
        }
        .rg_right >p:first-child{
            font-size: 10px;
        }
        .rg_right p a {
            color: pink;
        }

        .td_left{
            width: 100px;
            height: 40px;
            text-align: right;
        }
        .td_right{
            padding-left: 20px;
        }
        #username,#password,#email,#name,#phone,#address   {
            width: 180px;
            height: 25px;
            border: 1px solid #A6A6A6 ;
            border-radius: 5px;
            padding-left: 10px;
        }
        #checkcod{
            width: 90px;
        }
        #img_check{
            vertical-align: middle;
        }
        #btn_sub{
            width: 100px;
            height: 25px;

            border: solid #FFD026 1px;
            margin-left: 40px;
            margin-top: 20px;
        }


    </style>


    <script>
        function a1() {
            $.get({
                url:"${pageContext.request.contextPath }/user/a4",
                data:{"username":$("#username").val()},
                success:function (data) {
                    if (data.toString()==='ok') {
                        $("#user").css("color","green");
                        $("#user").html("用户名可用");
                        document.getElementById("btn_sub").disabled = false
                    }else {
                        $("#user").css("color","red");
                        $("#user").html("用户名不可用");
                        document.getElementById("btn_sub").disabled = true
                    }


                }

            })

        }

    </script>




</head>
<body>
<!--    最外边的-->
<div class="rg_layout">
    <!--    最左边的-->
    <div class="rg_left">
        <p >新商家注册</p>

    </div>


    <!--中间的-->
    <div class="rg_center">
        <div class="rg_from">
            <form action="${pageContext.request.contextPath}/user/adduser" method="post">
                <table >
                    <tr>
                        <td class="td_left"><label for="username">用户名</label> </td>
                        <td class="td_right"><input type="text" name="userCode" id="username" placeholder="请输入昵称" onblur="a1()" required="required"></td>
                    </tr>
                    <span id="user" style="margin-left: 170px;"></span>
                    <tr>
                        <td class="td_left"><label for="password">密码</label> </td>
                        <td class="td_right"><input type="password" name="userPassword" id="password" placeholder="请输入密码" required="required"></td>
                    </tr>
                    <tr>
                        <td class="td_left"><label for="name">姓名</label> </td>
                        <td class="td_right"><input type="text" name="userName" id="name" required="required"></td>
                    </tr>
                    <tr>
                        <td class="td_left"><label for="phone">手机号</label> </td>
                        <td class="td_right"><input type="text" name="phone" id="phone" required="required"></td>
                    </tr>
                    <tr>
                        <td class="td_left"><label>性别</label> </td>
                        <td class="td_right">
                            <input type="radio" name="gender" value="1" checked >男
                            <input type="radio" name="gender" value="2" >女
                        </td>
                    </tr>
                    <tr>
                        <td class="td_left"><label for="phone">地址</label> </td>
                        <td class="td_right"><input type="text" name="address" id="address" required="required"></td>
                    </tr>

                    <tr>
                        <td colspan="2" align="center"><input type="submit" id="btn_sub" value="注册" style="color: black;" ></td>
                    </tr>
                </table>
            </form>

        </div>

    </div>



    <!--最右边的-->
    <div class="rg_right">
        <P>已有账号？<a href="${pageContext.request.contextPath}/skip/skipUsersLogin">立即登录</a></P>
    </div>


</div>

<script src="${pageContext.request.contextPath }/js/jquery-3.6.0.js"></script>
</body>
</html>
